/*
** my_strdup.c for lib in /home/nadali_t//local/svn/myprintf-2016ed-2015s-2017si-nadali_t/lib
** 
** Made by thomas nadalie
** Login   <nadali_t@epitech.net>
** 
** Started on  Sun Nov 18 17:55:29 2012 thomas nadalie
** Last update Sun Nov 18 18:14:00 2012 thomas nadalie
*/

#include	<stdlib.h>
#include	"my.h"

char            *my_strdup(const char *src)
{
  char          *dest;
  int           i;

  i = 0;
  if ((dest = malloc((my_strlen(src) + 1) * sizeof(*dest))) == NULL)
    return (NULL);
  my_bzero(dest, my_strlen(src) + 1);
  while (src[i])
    {
      dest[i] = src[i];
      i++;
    }
  dest[i] = '\0';
  return (dest);
}
